package com.kamistoat.meimeimall.meimeimallproduct.web;

import com.kamistoat.meimeimall.common.annotation.DubboAndHTTPExceptionCatch;
import com.kamistoat.meimeimall.common.utils.R;
import com.kamistoat.meimeimall.meimeimallproduct.service.SpuInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "Spu管理页面")
@RestController
@RequestMapping("web")
public class SpuManagePageController {
    protected Logger logger = LoggerFactory.getLogger(SpuManagePageController.class);

    @Autowired
    SpuInfoService spuInfoService;

    /**
     * 测试
     *
     * @param spuPerBrand 设5. 10000个SPU
     * @return
     */
    @ApiOperation("构建测试Spu数据")
    @GetMapping("/construct_test_sku_data")
    // @LoginRequired
    @DubboAndHTTPExceptionCatch
    public R consturctTestSpuData(@RequestParam("spuPerBrand") Integer spuPerBrand) {
        spuInfoService.constructTestSpuData(spuPerBrand);
        return R.ok();
    }

}
